package com.itheima.dubbo.service.impl;

import com.itheima.dubbo.com.itheima.dubbo.UserFace;
import com.itheima.dubbo.com.itheima.dubbo.pojo.User;

import org.springframework.core.env.Environment;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

//@DubboService(retries =3,timeout = 2000)
@DubboService(cluster = "failfast")
public class UserServiceImpl implements UserFace {
    @Autowired
    private Environment environment;
    @Override
    public String hello(String name) {
        int i = 1 / 0;
        System.out.println("UserFaceImpl hello...."
                + environment.getProperty("server.port"));

        return "Hello Dubbo username=" + name;
    }

    @Override
    public User findByUser(User user) {
        return user;
    }
}
